home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / Softshoe / Lisa's Mac Parts / Processes / Process.cp next >
Text File  |  2000-06-23  |  747b  |  43 lines

  1. // Process.cp
  2.  
  3. #ifndef Process_h
  4. #include "Process.h"
  5. #endif
  6. #ifndef ProcessError_h
  7. #include "ProcessError.h"
  8. #endif
  9.  
  10. Process::Process( ApplicationProcess )
  11.   {
  12.     ThrowProcessError( GetCurrentProcess( &psn ) );
  13.   }
  14.  
  15. Process::Process( FrontProcess )
  16.   {
  17.     ThrowProcessError( GetFrontProcess( &psn ) );
  18.   }
  19.  
  20. const Process& Process::Application()
  21.   {
  22.     static Process theApplication( application );
  23.     return theApplication;
  24.   }
  25.  
  26. bool Process::operator==( const Process& r ) const
  27.   {
  28.     Boolean result;
  29.     ThrowProcessError( SameProcess( &psn, &r.psn, &result ) );
  30.     
  31.     return result;
  32.   }
  33.  
  34. void Process::Wake() const
  35.   {
  36.     ThrowProcessError( WakeUpProcess( &psn ) );
  37.   }
  38.  
  39. void Process::MoveToFront() const
  40.   {
  41.     ThrowProcessError( SetFrontProcess( &psn ) );
  42.   }
  43.